package com.yjz.jvm.ThreadLocal.新;

import lombok.SneakyThrows;


public class Test {

    @SneakyThrows
    public static void main(String[] args) {
        Thread.currentThread().setName("当前主线程");

        ThreadLocal<String> t = ThreadLocal.withInitial(() -> "我是第一个值");

        ThreadLocal<String> t1 = ThreadLocal.withInitial(() -> "我是第二个值");
        t.get();
        t1.get();
        /**
         * 查看threadLocals属性，发现以上俩个threadlocal都作为key村粗在thread绑定的hash表里面
         */
        System.out.println(Thread.currentThread());


    }
}
